home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
1201_300
/
DISK1262
/
DISK1262.ZIP
/
_STREND.D
< prev
next >
Wrap
Text File
|
1988-07-11
|
1KB
|
45 lines
; Doug's Programming Language -- DPL, Version 2.22
; Copyright (c) 1988 Douglas S. Cody, All rights reserved.
;----------------------------------
; _STREND -- MOVE THE TEXT POINT TO THE END OF THE STRING
;
; Entry conditions:
; SI holds the offset to the beginning of the string
; Exit conditions:
; SI points to the terminator in the string
; CX holds the length of the text, but not the terminator
;
SUBPGM _STREND
BEGIN _STREND
SUB AL,AL
SUB CX,CX
DEC SI
;
LOOPR:
INC SI
CMP AL,[SI] ; NULL TERMINATOR?
LOOPNE LOOPR ; IF NOT, CONTINUE LOOPING
NEG CX
DEC CX
RET
;
;
; _STRLEN -- GET THE LENGTH OF THE SOURCE STRING INTO CX
;
; Entry conditions:
; SI holds the offset to the beginning of the string
; Exit conditions:
; SI not changed
; CX holds the length of the text, but not the terminator
;
PUBLIC _STRLEN
_STRLEN PROC NEAR
PUSH SI
CALL _STREND
POP SI
RET
_STRLEN ENDP
;
ENDPGM _STREND
;